package com.luoying.itew.http;

import com.google.gson.JsonObject;
import com.luoying.itew.bean.UserInfo;

import java.util.Map;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

public interface AppApi {

    /**
     * 登录认证接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.USER_LOGIN)
    Call<BaseResponse<Map>> userLogin(@FieldMap Map<String, Object> map);

    /**
     * 地图相关信息
     *
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.USER_MAP_INFO)
    Call<BaseResponse<JsonObject>> userMapInfo(@FieldMap Map<String, Object> map);

    /**
     * 天气详情
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.WEATHER_INFO)
    Call<BaseResponse<JsonObject>> getWeatherInfo(@FieldMap Map<String, Object> map);

    /**
     * 用户信息
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.USER_INFO)
    Call<BaseResponse<UserInfo>> userInfo(@FieldMap Map<String, Object> map);

    /**
     * 采集器数据
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.COLLECTION_DATA_LIST)
    Call<BaseResponse<JsonObject>> collectionDataList(@Path("id")String id, @FieldMap Map<String, Object> map);

    /**
     * 图表信息
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.GET_CHARTS)
    Call<BaseResponse<Map>> getCharts(@Path("monitorPointId")String monitorPointId,@Path("isDateChar")int isDateChar, @FieldMap Map<String, Object> map);

    /**
     * 巡查日志
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.GET_LOG)
    Call<BaseResponse<Map>> getLOG(@Path("monitorPointId")String monitorPointId, @FieldMap Map<String, Object> map);

    /**
     * 反馈详情
     * @return
     */
    @GET(HttpConfig.GET_SIGN_DETAILS)
    Call<BaseResponse<Map>> getSignDetails(@QueryMap Map<String, Object> map);
    /**
     * 提交反馈
     * @return
     */
    @POST(HttpConfig.POST_LOG)
    Call<BaseResponse<String>> postLog(@Path("monitorPointId")String monitorPointId,@Path("userId")String userId,@Body RequestBody body);


    /**
     * 获取监测点3d数据详情
     * @param id 监测点数据
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.WALKER_3D_INFO)
    Call<BaseResponse<JsonObject>> get3dInfo(@Path("id")String id, @FieldMap Map<String, Object> map);

    /**
     * 下载文件方法
     * @param url
     * @return
     */
    @Streaming
    @POST
    Call<ResponseBody> down3dFile(@Url String url);

    /**
     * 采集器信息
     * @param monitorPointId
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.COLLECT_DETAIL)
    Call<BaseResponse<Map>> collectDetail(@Path("monitorPointId") int monitorPointId, @FieldMap Map<String, Object> map);

    /**
     * 位移时图表
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.HOUR_CHART)
    Call<BaseResponse<Map>> hourChart(@FieldMap Map<String, Object> map);

    /**
     * 单点登录传递设备id
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.APP_SSO_ID)
    Call<BaseResponse<Map>> updateUUid(@FieldMap Map<String, Object> map);


    /**
     * 极光绑定
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.JIGUANG_BIND)
    Call<BaseResponse<String>> jiguangBind(@FieldMap Map<String, Object> map);

    /**
     * 退出APP
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.BREAK_APP)
    Call<BaseResponse<String>> breakApp(@FieldMap Map<String, Object> map,@Path("userId") int monitorPointId,@Path("flag") int flag);

    /**
     * 获取监测点图片列表
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.GET_IMG_LIST)
    Call<BaseResponse<Map<String,String>>> getImgList(@FieldMap Map<String, Object> map);

    /**
     * 大气压数据
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.GET_ATMOS)
    Call<BaseResponse<Map>> getAtmos(@FieldMap Map<String, Object> map);

    /**
     * 3d模型所有采集器数据
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.COLLECTOR_LIST)
    Call<BaseResponse<JsonObject>> getCollectorList(@FieldMap Map<String, Object> map);

    /**
     * 测斜仪数据
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.INCLINOMETER_CHAT)
    Call<BaseResponse<Map>> getInclinometerChat(@FieldMap Map<String, Object> map);

}
